﻿<html>

	<head>
		<title>店铺用户管理</title>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<link rel="stylesheet" href="../../css/dialog.css">
		<link href="../../css/skin/default/style.css" rel="stylesheet" type="text/css" />
		<link href="../../js/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />

		<script src="../../js/lib/jquery/jquery-1.10.2.min.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerComboBox.js"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerForm.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTextBox.js" type="text/javascript"></script>
		<script src="../../js/lib/json2.js" type="text/javascript"></script>
		<script src="../../js/dialog.js"></script>
		<script src="../../js/JS/layout.js"></script>
		<script src="../../js/constants.js" type="text/javascript"></script>
		<script src="../../js/api.js" type="text/javascript"></script>
		<script src="../../js/JS/jquery.md5.js" type="text/javascript"></script>
		<style>
			a:hover {
				cursor: pointer;
			}
			dt{width: 60px;}
		</style>
		<script type="text/javascript">
			var data = JSON.parse(unescape($api.getparastr("data")));
			
			$(function() {
				$("form").ligerForm();
				if(data) {
					initView(data);
				}
				else
					$(".divhead").text("填写["+unescape( $api.getparastr("Fname"))+"]用户信息");
			 
				$(".rule-multi-radio").ruleMultiRadio();
			});

			var UID;

			function initView(data) {
				UID = data.Fid;
				$api.loadJsonToForm(data);
				if(data.Fstatus==1)
				  $('input[type="radio"][name="Fstatus"]').eq(0).attr("checked", "checked");
				else
					$('input[type="radio"][name="Fstatus"]').eq(1).attr("checked", "checked");
			 
				
			}

			function f_save() {
				if($api.isEmpty($("#Floginname").val())) {
					$.ligerDialog.error("登录名不能为空！");
					return null;
				}
 

				if($api.isEmpty(data)) {
					if($api.isEmpty($("#Fpwd").val())) {
						$.ligerDialog.error("请设置登录密码！");
						return null;
					}
					if($("#Fpwd").val().length < 6) {
						$.ligerDialog.error("登陆密码不能小于6位！");
						return null;
					}
					 
					var ret = $("form").serializeObject();
					ret.Fpwd = $.md5($("#Fpwd").val());
					ret.Froleid = 3; 
					ret.Fsid=$api.getparastr("Fsid");
					ret.Fisboss=1;
					var obj = {
						"data":ret,
						"action":"add"
					}
					return obj;
				
				} else {
					var Fpwd = "";
					if(!$api.isEmpty($("#Fpwd").val()) 
					&& $("#Fpwd").val().length < 6) {
						$.ligerDialog.error("登陆密码不能小于6位！");
						return null;
					}
					var ret = $("form").serializeObject();
					ret.Fpwd = $.md5($("#Fpwd").val());
					ret.Froleid = 3; 
					ret.Fid=UID;
					ret.Fisboss=1;
					ret.Fsid= data.Fsid;
					var obj = {
						"data":ret,
						"action":"edit"
					}
					return obj; 
				}
			}
		</script>
	</head>

	<body class="mainbody">
		<form>
			<!--内容-->

			<div class="div-content">
				<div class="divhead">填写用户信息</div>
				<hr class="divline" />
				<dl>
					<dt>用户名</dt>
					<dd>
						<div style="float:left">
							<input type="text" id="Floginname" maxlength="16" name="Floginname" ltype="text" ligerui="{width:200}" validate="{required:true,minlength:4,maxlength:30}" />
						</div>
						<div style="float:left"> <span class="Validform_checktip" id="lnum" style="float:left">*用户名最多16个字符，登录App时使用</span></div>
					</dd>
				</dl> 
				<dl>
					<dt>用户姓名</dt>
					<dd>
						<div style="float:left">
							<input type="text" id="Fusername" maxlength="16" name="Fusername" ltype="text" ligerui="{width:200,digits:true}"   />
						</div>

					</dd>
				</dl>
				<dl>
					<dt>密码</dt>
					<dd>
						<div style="float:left">
							<input type="password" id="Fpwd" maxlength="16" name="Fpwd" ltype="text" ligerui="{width:200}" validate="{required:true,minlength:4,maxlength:30}" />
						</div>
						<div style="float:left">
							<span class="Validform_checktip" style="float:left">*初始密码为用户手机号码</span></div>

					</dd>
				</dl>

				<dl>
					<dt>描述</dt>
					<dd>
						<div style="float:left">
							<input type="text" id="Fmemo" name="Fmemo" ltype="text" ligerui="{width:360}" validate="{required:true}" />
						</div>
					</dd>
				</dl>
				<dl>
					<dt>状态</dt>
					<dd>
						<div class="rule-multi-radio">
							<label><input type="radio" value="1" checked="checked"  name="Fstatus">正常</label>
							<label><input type="radio" value="2"  name="Fstatus">冻结</label>
						</div>
					</dd>
				</dl>
			</div>
		</form>
	</body>

</html>